<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>订单详情</title>
	<meta name="decorator" content="default"/>
	<style type="text/css">
		.table td {
			vertical-align: middle;
		}
	</style>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
	</script>
</head>
<body>
<form:form id="inputForm">
	<div style="margin:10px;">
		<table id="contentTable" class="table table-striped table-bordered table-condensed">
			<thead>
				<tr>
					<th width="100">订单编号</th>
					<th width="80">商品编号</th>
					<th width="175">商品名称</th>
					<th width="80">数量</th>
					<th width="80">金额</th>
				</tr>
			</thead>
			<tbody>
			<c:forEach items="${list}" var="order">
				<c:if test="${fn:length(order.detailList)>0}">
					<tr>
						<td rowspan="${fn:length(order.detailList) }">${order.orderNo }</td>
						<td>${order.detailList[0].product.code }</td>
						<td>${order.detailList[0].product.name }</td>
						<td style="text-align: right;">${order.detailList[0].number}${order.detailList[0].product.productUnit.name}</td>
						<td style="text-align: right;">${order.detailList[0].amount }元</td>
					</tr>
					<c:if test="${fn:length(order.detailList)>1}">
					<c:forEach items="${order.detailList}" var="detail" begin="1">
					<tr>
						<td>${detail.product.code }</td>
						<td>${detail.product.name }</td>
						<td style="text-align: right;">${detail.number}${detail.product.productUnit.name}</td>
						<td style="text-align: right;">${detail.amount }元</td>
					</tr>
					</c:forEach>
					</c:if>
				</c:if>
			</c:forEach>
			</tbody>
		</table>
	</div>
</form:form>
</body>
</html>